package co.com.inventarios.modelo;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * RequiDocId entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Embeddable
public class RequiDocId implements java.io.Serializable {

	// Fields

	private String reqempresa;
	private String reqclase;
	private String reqtipo;
	private Double reqnumero;

	// Constructors

	/** default constructor */
	public RequiDocId() {
	}

	/** full constructor */
	public RequiDocId(String reqempresa, String reqclase, String reqtipo,
			Double reqnumero) {
		this.reqempresa = reqempresa;
		this.reqclase = reqclase;
		this.reqtipo = reqtipo;
		this.reqnumero = reqnumero;
	}

	// Property accessors

	@Column(name = "REQEMPRESA", unique = false, nullable = false, insertable = true, updatable = true, length = 3)
	public String getReqempresa() {
		return this.reqempresa;
	}

	public void setReqempresa(String reqempresa) {
		this.reqempresa = reqempresa;
	}

	@Column(name = "REQCLASE", unique = false, nullable = false, insertable = true, updatable = true, length = 4)
	public String getReqclase() {
		return this.reqclase;
	}

	public void setReqclase(String reqclase) {
		this.reqclase = reqclase;
	}

	@Column(name = "REQTIPO", unique = false, nullable = false, insertable = true, updatable = true, length = 4)
	public String getReqtipo() {
		return this.reqtipo;
	}

	public void setReqtipo(String reqtipo) {
		this.reqtipo = reqtipo;
	}

	@Column(name = "REQNUMERO", unique = false, nullable = false, insertable = true, updatable = true, precision = 13, scale = 1)
	public Double getReqnumero() {
		return this.reqnumero;
	}

	public void setReqnumero(Double reqnumero) {
		this.reqnumero = reqnumero;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof RequiDocId))
			return false;
		RequiDocId castOther = (RequiDocId) other;

		return ((this.getReqempresa() == castOther.getReqempresa()) || (this
				.getReqempresa() != null
				&& castOther.getReqempresa() != null && this.getReqempresa()
				.equals(castOther.getReqempresa())))
				&& ((this.getReqclase() == castOther.getReqclase()) || (this
						.getReqclase() != null
						&& castOther.getReqclase() != null && this
						.getReqclase().equals(castOther.getReqclase())))
				&& ((this.getReqtipo() == castOther.getReqtipo()) || (this
						.getReqtipo() != null
						&& castOther.getReqtipo() != null && this.getReqtipo()
						.equals(castOther.getReqtipo())))
				&& ((this.getReqnumero() == castOther.getReqnumero()) || (this
						.getReqnumero() != null
						&& castOther.getReqnumero() != null && this
						.getReqnumero().equals(castOther.getReqnumero())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getReqempresa() == null ? 0 : this.getReqempresa()
						.hashCode());
		result = 37 * result
				+ (getReqclase() == null ? 0 : this.getReqclase().hashCode());
		result = 37 * result
				+ (getReqtipo() == null ? 0 : this.getReqtipo().hashCode());
		result = 37 * result
				+ (getReqnumero() == null ? 0 : this.getReqnumero().hashCode());
		return result;
	}

}